<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

	<rich:panel id="Edit">
		<h:panelGrid>


			<a4j:form>
				<h:panelGrid columns="2">
						<s:decorate template="/layout/input.xhtml">
							<ui:define name="label">Tipo Documento</ui:define>
							<rich:comboBox value="#{editPerson.editDoc.docType}" 
								id="DocType"
								converter="#{refConverter}"
								converterMessage="Favor seleccione el tipo de documento"
								defaultLabel="Seleccione tipo de documento"
								enableManualInput="true"
								required="true"
								requiredMessage="Favor seleccione el tipo de documento"
								>
															
									<s:selectItems  value="#{withinHolder.refDetListByHeadCod(editPerson.docType)}" var="ref" label="#{ref.descrip}">
									</s:selectItems>
									
							</rich:comboBox>	
							<div class="msg_container">
								<rich:message for="DocType" />
							</div>
						</s:decorate>
		
						<div style="clear: both;" />
						<s:decorate template="/layout/input.xhtml">
							<ui:define name="label">Pais</ui:define>
							<rich:comboBox value="#{editPerson.editDoc.countryData}"
								id="DocCountry" required="true" size="30"
								requiredMessage="Favor seleccione el pais"
								enableManualInput="true"
								converter="#{countryConverter}"
								defaultLabel="Pais">
								<a4j:support event="onblur" ajaxSingle="true" />
		
								<s:selectItems var="country" value="#{withinHolder.countryList()}">
									<h:outputText value="#{country.descrip}" />
								</s:selectItems>
		
		
							</rich:comboBox>
							<div class="msg_container">
								<rich:message for="DocCountry" />
							</div>
						</s:decorate>
						
						<div style="clear: both" />
						<s:decorate template="/layout/input.xhtml">
							<ui:define name="label">Nro Documento</ui:define>
							<h:inputText id="Doc" maxlength="40"
								value="#{editPerson.editDoc.document}"
								required="true" size="30"
								requiredMessage="Favor introduzca el nro de documento"
								validatorMessage="El nro de documento no puede ser menor a 5 o mayor a 20">
								<f:validateLength minimum="5" maximum="20" />
								<a4j:support event="onblur" ajaxSingle="true" />
							</h:inputText>
							<div class="msg_container">
								<rich:message for="Doc" />
							</div>
						</s:decorate>
						<div style="clear: both" />
						<s:decorate template="/layout/input.xhtml">
							<ui:define name="label">Activo</ui:define>
							<h:selectBooleanCheckbox id="DocActive"
								value="#{editPerson.editDoc.status}">
								<a4j:support event="onblur" ajaxSingle="true" />
								<a4j:support event="onclick" ajaxSingle="true">
									<s:conversationId />
								</a4j:support>
							</h:selectBooleanCheckbox>
						</s:decorate>
						
						<div style="clear: both" />
						<s:decorate template="/layout/input.xhtml">
							<ui:define name="label">Default</ui:define>
							<h:selectBooleanCheckbox id="DocDefault"
								value="#{editPerson.editDoc.isDefault}">
								<a4j:support event="onblur" ajaxSingle="true" />
								<a4j:support event="onclick" ajaxSingle="true">
									<s:conversationId />
								</a4j:support>
							</h:selectBooleanCheckbox>
						</s:decorate>
						

					</h:panelGrid>
						
		
				<s:decorate template="/layout/displayButton.xhtml">
					<a4j:commandButton value="Guardar"
						action="#{editPerson.docUpd()}"
						oncomplete="#{rich:component('PersonDocModalPanel')}.hide()"
						reRender="updPersonDocForm, updDocGridForm" />
					<rich:spacer width="20px" />
					<h:commandButton value="Cancelar"
						oncomplete="#{rich:component('PersonDocModalPanel')}.hide()" />
				</s:decorate>
				</a4j:form>
		
		</h:panelGrid>
	</rich:panel>
</ui:composition>